import java.util.ArrayList;
public class studentSystem {
    public static void main(String[] args) {
        // 创建一个ArrayList来存储Student对象
        ArrayList<Students> list = new ArrayList<>();
        list.add(new Students(1,"张三"));
        list.add(new Students(2,"李四"));
        list.add(new Students(1,"王五"));
        for (int i = 0; i < list.size(); i++) {
            Students  s =list.get(i);
            if (s.getName().equals("张三")){
                s.setName("张三丰");
            }
            if (s.getName().equals("王五")){
                list.remove(s);
            }
        }
        for (int i = 0; i < list.size(); i++) {
            System.out.println(
                    list.get(i)
            );
        }

    }
}
